package com.cxytiandi.sharding.repository;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;

import com.cxytiandi.sharding.po.User;


@Mapper
public interface UserRepository {

    /**
     * 添加
     *
     * @param user user
     * @return id
     */
    Long addUser(User user);

    /**
     * 查询list
     *
     * @return list
     */
    List<User> list();

    /**
     * 根据id 查询
     *
     * @param id id
     * @return user
     */
    User findById(Long id);

    /**
     * 根据name 查询
     *
     * @param name name
     * @return user
     */
    User findByName(String name);
}
